package customerEnter.Frame.ehcache.Judge;

import customerEnter.tool.WhetherToEmpty;

/**
 * 判斷值的準確性
 * 
 * 类名称：MapEcacheTrueOrFalse 类描述： 创建人：dy 创建时间：2016-4-27 上午11:19:15
 * 
 */
@SuppressWarnings({ "static-access" })
public class MapEcacheTrueOrFalse {
	private static MapEcacheTrueOrFalse	mapEcacheTrueOrFalse;
	private final static String			setMap	= "Judge";

	private MapEcacheTrueOrFalse() {

	}

	public static MapEcacheTrueOrFalse getMapEcacheTrueOrFalse() {
		if (WhetherToEmpty.ObjectWhetherToEmpty(mapEcacheTrueOrFalse)) {
			mapEcacheTrueOrFalse = new MapEcacheTrueOrFalse();
		}
		return mapEcacheTrueOrFalse;
	}

	/**
	 * 設置緩存準確性
	 */
	public static void SetDataIf(String key, Boolean Judge) {
		MapEcache.getMapEcache(setMap).setEachMap(key, Judge);
	}

	public static Boolean GetDataIf(String key) {
		Boolean boolean1 = false;
		try {
			boolean1 = (Boolean) MapEcache.getMapEcache(setMap).getEachMap(key);
		} catch (Exception e) {
			boolean1 = false;
		}
		boolean1 = !WhetherToEmpty.ObjectWhetherToEmpty(boolean1);
		return boolean1;
	}

}
